<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>团队列表</title>
    <style>
        /* 设置左侧按钮区域的样式 */
        .sidebar {
            width: 200px;
            height: 100vh;
            float: left;
            padding-top: 20px;
            background-color: #f4f4f4;
            border-right: 2px solid #ddd;
        }

        .sidebar button {
            display: block;
            width: 180px;
            margin: 10px 0;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
        }

        .sidebar button:hover {
            background-color: #45a049;
        }

        /* 设置右侧内容区域的样式 */
        .content {
            margin-left: 220px; /* 给右侧内容留出空间 */
            padding: 20px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th, td {
            padding: 10px;
            text-align: left;
            border: 1px solid #ddd;
        }

        th {
            background-color: #f2f2f2;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        a {
            color: #4CAF50;
            text-decoration: underline;
        }

        a:hover {
            color: #45a049;
        }
    </style>
</head>
<body>
<!-- 左侧按钮区域 -->
<div class="sidebar">
    <!-- 按钮范围开始 -->
    <button onclick="window.location.href='/viewTeams'">查看团队</button>
    <button class="button" onclick="window.location.href='/interactiveFeature'">互动功能</button>
    <!-- 按钮范围结束 -->
</div>

<!-- 右侧内容区域 -->
<div class="content">
    <h1>团队列表</h1>

    <!-- 搜索框 -->
    <form action="/viewTeams" method="get">
        <input type="text" name="search" placeholder="请输入团队名称进行搜索" value="${param.search}">
        <button type="submit">搜索</button>
    </form>

    <!-- 团队列表 -->
    <table border="1">
        <thead>
        <tr>
            <th>团队名称</th>
            <th>研究方向</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="team" items="${teams}">
            <tr>
                <td>${team.teamName}</td>
                <td>${team.researchField}</td>
                <td>
                    <a href="/teamDetails/${team.teamId}">查看详情</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
